﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NEWS;

public partial class admin_menu_add : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        NEWS.Model.Menu menu = new NEWS.Model.Menu();
        menu.State = int.Parse(this.state.Text);
        menu.Title = this.title.Text;

        if (NEWS.BLL.Menu.add(menu))
        {
            NEWS.JsHelper.AlertAndRedirect("添加成功！", "menu_list.aspx");
        }
        else 
        {
            NEWS.JsHelper.AlertAndRedirect("添加失败！", "menu_add.aspx");
        }
    }
}